package com.xiong.lambda;

import com.alibaba.fastjson.JSONObject;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class Test {

    public static void main(String[] args) {
        List<Map<String,Object>> mapList=new ArrayList<>();
        Map<String,Object> map1=new HashMap<>();
        map1.put("title","标题1");
        Map<String,Object> map2=new HashMap<>();
        map2.put("title","标题2");
        mapList.add(map1);
        mapList.add(map2);

        LambdaModel model=new LambdaModel(mapList);
        model.forEach((e)->{
            System.out.println(JSONObject.toJSONString(e));
        }).filter((e)->{
            Object val=e.get("title");
            return val.equals("标题1");
        });

        System.out.println(JSONObject.toJSONString(model.getMapList()));

    }
}
